#coding:utf-8

##建立用户信息库，下面中文都是备注
from django.db import models
class User(models.Model):
    USER_TYPE = (
        (0, '管理员'),
        (1, '普通用户'),
    )

    USER_STATE =  (
        (0, '正常'),
        (1, '删除'),
    )


    user_type = models.SmallIntegerField('类型', choices = USER_TYPE, default = 0)
    name = models.CharField('用户名', max_length = 100)
    password = models.CharField('密码', max_length = 100)
    state = models.SmallIntegerField('状态', choices = USER_STATE, default = 0)
    ch_name = models.CharField('姓名',max_length = 1000)
    def __str__(self):
        return u'%s %s %s' % (self.name, self.user_type,self.ch_name)
